﻿using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace PlutoStudio.Aspects
{
    public static class InterceptorHelper
    {
        /// <summary>
        /// Returns true if given method has UnitOfWorkAttribute attribute.
        /// </summary>
        /// <param name="methodInfo">Method info to check</param>
        internal static bool HasInterceptorAttribute(MemberInfo methodInfo)
        {
            return methodInfo.IsDefined(typeof(InterceptorAttribute), true);
        }

        public static void AddConventionalRegistrar(IConventionaInterceptorRegistrar registrar)
        {
            InterceptorInstaller.Registrars.Add(registrar);
        }

    }
}
